﻿using System.Globalization;
using System.Windows.Controls;

namespace BluetoothMachine.ValidationRules
{
    public class DetectIntegerValidationRule : ValidationRule
    {
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            if (value != null && !double.TryParse(value.ToString(), out double count))
            {
                return new ValidationResult(false, "请输入正确的数字");
            }
            return ValidationResult.ValidResult;
        }
    }
}
